package com.candy.bean;

public  class Person {
//    属性
    protected   String name;
    boolean sex;
    private int age;
//    静态属性，类所有
    public static final String schoolName="内蒙古师范大学";

    public Person() {
        System.out.println("调用了Person类的构造函数");
    }

//    public Person(String name, boolean sex, int age) {
//        this.name = name;
//        this.sex = sex;
//        this.age = age;
//    }

    {

    }

    //    方法
    public void eat(){
        int num=5;
        System.out.println("吃红烧肉。。。。");
    }
    public void eat(String name){
        System.out.println(name);

    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }

//    静态方法
    public static void sayHello(){
        System.out.println("大家好");
    }
}
